package com.roc.steelend.controller;


import com.roc.steelend.pojo.SmallType;
import com.roc.steelend.service.ComparisonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

@RestController
@Api(tags = "开平对照表功能接口")
@CrossOrigin
public class ComparisonController {

  @Autowired
    private ComparisonService comparisonService;

  @GetMapping("/v1/comparison")
    public SmallType findJuanBanIdByPingBanId(@RequestParam(value = "juanBanId",required = true)Integer juanBanId){

      return  comparisonService.findJuanBanIdByPingBanId(juanBanId);
  }

  @GetMapping("/v1/comparison/showAll")
  @ApiOperation(value = "展示所有的开平产品对照表")
  public List<HashMap<String,Object>> findAllComparison(){
      return comparisonService.findAllComparison();
  }
}
